package com.rxyb.sms.gateway.controller;


import com.rxyb.core.respone.R;
import com.rxyb.sms.gateway.dto.SendSmsReq;
import com.rxyb.sms.gateway.dto.SendSmsRsp;
import com.rxyb.sms.service.SmsManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 短信发送 前端控制器
 * </p>
 *
 * @author DUYH
 * @since 2020-06-11
 */
@RestController
@RequestMapping(value = "/sms", produces = {MediaType.APPLICATION_JSON_UTF8_VALUE})
public class SmsManageController {

    @Autowired
    private SmsManageService smsManageService;

    /**
     * 短信发送
     *
     * @author duyh
     */
    @PostMapping(value = "send", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public R<SendSmsRsp> send(@Validated @RequestBody SendSmsReq sendSmsReq) {
        return smsManageService.send(sendSmsReq);
    }

}
